﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Data;

namespace Opskriftssamling
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            List<Opskrift> opskrifter = new XMLParser().read().Values.ToList<Opskrift>();
            foreach (Opskrift o in opskrifter)
            {
                label1.Text += o.Titel + "\n" + o.Maengde.ToString() + " " + o.Enhed + "\n";
                foreach (Ingrediens ing in o.Ingredienser)
                {
                    label1.Text += "\t" + ing.Titel + "\t" + ing.Maengde + " " + ing.Enhed + "\n";
                }
                label1.Text += o.Fremgangsmaade + "\n";
                foreach (Opskrift op in o.Relaterede.Values)
                {
                    label1.Text += "Relaterede opskrifter: " + op.Titel + "\n";
                }
                label1.Text += "\n\n";
            }
        }
    }
}
